This introductory module bridges the gap between raw, unstructured character arrays and the mathematical rigor of formal language theory. We transition from imperative searching—manual character-by-character inspection—to declarative specification, where we define a formal grammar representing the infinite set of valid strings.
1. The Nature of String Entropy
Raw data is inherently "messy" because it lacks structure; it is merely a sequence of bytes until a formal grammar categorizes its constituents. In protocol design, validating this entropy is the first line of defense against malformed inputs.
2. Paradigms & Automata
Regex is rooted in the Chomsky Hierarchy. Regular expressions serve as blueprints for building Deterministic Finite Automata (DFA). Instead of writing if-else chains to find patterns, we define what the pattern is, allowing the engine to handle traversal logic.